﻿using CodingBlog.Core.Model;
using CodingBlog.Core.Repository;
using CodingBlog.Core.Repository.Contract;
using CodingBlog.Core.Service.Contract;

namespace CodingBlog.Core.Service
{
    public class BlogService : IBlogService
    {
        private IBlogRepository blogRepository;

        public BlogService()
        {
            blogRepository = new BlogRepository();
        }

        public BlogService(IBlogRepository blogRepository)
        {
            this.blogRepository = blogRepository;
        }

        public Blog GetDefaultBlog()
        {
            return blogRepository.GetDefaultBlog();
        }

        public Blog CreateBlog(Blog blogToCreate)
        {
            return blogRepository.CreateBlog(blogToCreate);
        }

        public int GetBlogsCount()
        {
            return blogRepository.GetBlogsCount();
        }
    }
}